#pragma once
#include "Event.h"

class Task
{
	enum State
	{
		INACTIVE,
		ACTIVE,
		PAUSED,
		STOPPED
	};

public:
					Task();
	virtual			~Task();

public:
	void			Start();
	void			Stop();
	void			Pause();
	void			Send(Event* evt);

public:
	State			GetState()		{return m_State;}
	bool			IsSystemTask()	{return m_IsSystemTask;}

protected:
	virtual void	OnStart()				{}
	virtual void	OnStop()				{}
	virtual void	OnPause()				{}
	virtual void	OnResume()				{}
	virtual void	OnEvent(Event* evt)		{}

private:
	State			m_State;

private:
	friend class	TaskService;
	bool			m_IsSystemTask;
};